using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;

namespace Baz
{
    public class Sprite
    {
        public Vector2 Position = Vector2.Zero;
        protected Texture2D _texture;
        public Rectangle boundBox = new Rectangle();
        public Boolean collidable = new Boolean();
        public float _rotation = 0f;
        public float _zIndex = 0f;
        public SpriteEffects effect = SpriteEffects.None;

        public Sprite() { 
        Position= new Vector2();
        boundBox=new Rectangle();
        collidable = new bool();
        }

        public Sprite(Texture2D texture)
        {
            this._texture = texture;
        }

        /// <summary>
        /// Getters and Setters for _texture
        /// </summary>
        public Texture2D Texture
        {
            get { return _texture; }
            set { _texture = value; }
        }

        /// <summary>
        /// - Updates the Sprite using game time and the Animation
        ///   update method.
        /// - Also has error checking for null (no animation set)
        ///   animation and empty Animations Dictionary.
        /// </summary>
        /// <param name="gameTime">Elapsed Game Time</param>
        public virtual void Update (GameTime gameTime)
        {
            boundBox = new Rectangle((int)Position.X, (int)Position.Y,_texture.Width,_texture.Height);
        }

        /// <summary>
        /// Basic method of drawing a sprite
        /// </summary>
        /// <param name="batch">Batch for drawing sprites</param>
        public virtual void Draw(SpriteBatch batch)
        {
            batch.Draw(_texture, Position, new Rectangle(), Color.White, _rotation, Vector2.Zero, Vector2.Zero, effect, _zIndex);

        }
    }
}
